package com.project.controller;

import com.github.pagehelper.PageInfo;
import com.project.bean.BuyBean;
import com.project.service.IBuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;

@RestController
@RequestMapping("buyInfo")
public class BuyInfoController {
    @Autowired
    private IBuyService service;
    @RequestMapping("findAll")
    public PageInfo<BuyBean> findAll(int pageNO, String supName, LocalDate startDate, LocalDate endDate){
        return service.cutByItem(pageNO, supName, startDate, endDate);
    }
    @RequestMapping("findById")
    public BuyBean findById(int buyId){
        return service.findById(buyId);
    }
}
